<div class="nav-sub w1180">
	<ul class="zoom">
		<li><a  class="on" href="/crm/financial/index">结算管理</a></li>
		<li><a href="/crm/financial/list">账户流水</a></li>
	</ul>
</div>
<div class="main-ct w1180">
		<div class="top-bar">
			<div class="custom-search">
				<label>城市<select class="category-select" id="city_id">
					<option value="">未分类</option>
					<?php foreach ($this->city as $city):?>
					<option value="<?php echo $city['city_id'];?>"><?php echo $city['city_name'];?></option>
					<?php endforeach;?>
				</select></label>
				<label>商户类型<select class="category-select" id="catalog_id" style="width:80px;">
					<option value="">未分类</option>
					<?php foreach ($this->catalog as $catalog):?>
					<option value="<?php echo $catalog['catalog_id'];?>"><?php echo $catalog['catalog_name'];?></option>
					<?php endforeach;?>
				</select></label>
				<label>商户<select class="category-select" id="org_id" style="width:160px;">
					<option value="">未分类</option>
					<?php foreach ($this->organization as $organization):?>
					<option value="<?php echo $organization['org_id'];?>"><?php echo $organization['org_name'];?></option>
					<?php endforeach;?>
				</select></label>
				<label>开始日期<input style="width:95px;" id="start_time" type="text" class="tp-txt" onFocus="WdatePicker({isShowClear:true,readOnly:true})"></label>
				<label>结束日期<input style="width:95px;" id="end_time" type="text" class="tp-txt" onFocus="WdatePicker({isShowClear:true,readOnly:true})"></label>
				<a href="javascript:search();" class="btn-cs btn-search ml5">查 询</a>
				<a href="javascript:outExcel();" class="btn-cs btn-green ml5">导出</a>
			</div>
		</div>
		<div class="row" id="order_list_table">

		</div>
</div>
<script src="/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
var page = 1;
var city_id = $("#city_id").val();
var catalog_id = $("#catalog_id").val();
var org_id = $("#org_id").val();
var start_time = $("#start_time").val();
var end_time = $("#end_time").val() ;

$(document).ready(function(){
	ajaxListTable();
});

function search(){
	page = 1;
	city_id = $("#city_id").val();
	catalog_id = $("#catalog_id").val();
	org_id = $("#org_id").val();
	start_time = $("#start_time").val();
	end_time = $("#end_time").val() ;

	ajaxListTable();
}
function outExcel(){
	window.location.href="/crm/financial/excel-balance?"+ 
	'city_id=' + city_id + 
	"&catalog_id=" + catalog_id + 
	"&org_id=" + org_id + 
	"&start_time=" + start_time + 
	"&end_time=" + end_time;
}

function ajaxListTable(){
	$.ajax({
        type: "post",
        url : "<?php echo $this->url('crm/financial',
            array('action'=>'ajax-order-list'));?>",
        dataType:'html',
        data:  { 
            "city_id": city_id, 
            "catalog_id": catalog_id, 
            "org_id": org_id, 
			"start_time": start_time, 
			"end_time": end_time,
			"page":page },
        cache: false,
        timeout:10000, 
        error: function(){
          	 alert('请求超时，请重新操作');
           	 isPost = false;
             return false; 
         }, 
        success: function(html){
        	$("#order_list_table").html(html);
        }
    });
}

</script>